<template>
  <div class="app-container bg-gray">
    <el-card class="box-1">
      <div slot="header"><span>会员详情</span></div>
      <el-form ref="form" :model="form" label-width="160px">
        <el-form-item label="用户名：">{{ form['name'] }}</el-form-item>
        <el-form-item label="公司：">{{ form['company'] }}</el-form-item>
        <el-form-item label="职位：">{{ form['position'] }}</el-form-item>
        <el-form-item label="手机：">{{ form['mobile'] }}</el-form-item>
        <el-form-item label="微信：">{{ form['wechat'] }}</el-form-item>
        <el-form-item label="QQ：">{{ form['qq'] }}</el-form-item>
        <el-form-item label="注册时间：">{{ form['create_time'] }}</el-form-item>
        <el-form-item label="用户等级：">{{ form['level_name'] }}</el-form-item>
      </el-form>
    </el-card>
    <el-card class="box-2">
      <div slot="header"><span>留言内容</span></div>
      <el-form ref="form" :model="form" label-width="20px">
        <el-form-item style="color: #b7b7b7;">{{ form['content'] }}</el-form-item>
        <el-form-item>
          <el-image v-for="item in form['picture_list']" :key="item" :src="item" :preview-src-list="[item]" style="width:120px;height: 120px;margin-right: 20px;"/>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // ImageUrl: this.$store.getters.serverUrl,
ImageUrl: '',

      form: {
        id: '',
        name: '',
        sex: '男',
        mobile: '',
        email: '',
        type: '',
        avatar: '',
        level: ''
      }
    }
  },
  created() {
    this.loadInfo(this.$route.query.id)
  },
  methods: {
    loadInfo(id) {
      const url = 'activity/proposalInfo/' + id
      this.$store.dispatch('GetConnect', { url }).then(res => {
        Object.assign(this.form, res.data)
      }).catch(e => {
        this.$message.error(e.msg + ',请刷新或联系管理员')
      })
    }
  }
}
</script>

<style lang="scss" type="text/scss" scoped>
  @import '../../../styles/index.scss';
  .app-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
  }
  .box-1, .box-2 {
    max-width: 500px;
    min-width: 300px;
    margin-right: 40px;
    flex: 1;
    .el-form {
      max-width: 900px;
      .title {
        font-weight: 600;
      }
      .remark {
        font-size: 13px;
        color: $textGray;
      }
      .el-button {
        @extend .bg-green;
        width: 20%;
        min-width: 160px;
      }
    }
  }

  .box-2 {
    max-width: 800px;
    min-width: 500px;
    flex: 1;
  }
</style>
